<?php
GLOBAL $CFG;
require_once('../../../config.php');

require_once($CFG->libdir . '/formslib.php');
require_once($CFG->dirroot . '/local/blackboxsurvey/lib.php');
require_once($CFG->dirroot . "/local/blackboxsurvey/forms.php");

//yeu cau login,sau khi login tu dong chuyen sang trang chu
global $USER;
if ($USER->id == null){
    $SESSION->homepage = true;
    require_login($SITE);
}
if($SESSION->homepage){
    $SESSION->homepage = null;
    redirect( $CFG->wwwroot);
}

//class
require_once($CFG->dirroot . "/local/blackboxsurvey/class/matching.php");
$path = $CFG->wwwroot.'/local/blackboxsurvey/matcher/manage_bbsurvey.php';
$path_image = $CFG->wwwroot .'/local/blackboxsurvey/image/';

$check_admin = required_param('s', PARAM_TEXT);
$id_bbsurvey = required_param('id_bbsurvey', PARAM_TEXT);
//Them thanh menu ngang ung voi trang trong duong link
//navigation_node::override_active_url(new moodle_url($path, array('param'=>'value')));

/* Chuan bi trang web can hien thi */	
//$url = new moodle_url($path);
//$PAGE->set_url($url);
//$PAGE->set_title('Matching Survey Management');
//$PAGE->set_heading('Matching Survey Management');
//$PAGE->set_pagelayout('standard');

echo $OUTPUT->header();

$str = '<div id="Filter" >'.get_string('search', 'local_blackboxsurvey').': <input type=text id="FilterTextBox" name="FilterTextBox" size="40"/><img onclick="clear_filter_edit_only();" style="cursor:pointer;" src="'.$path_image.'clear.jpg"/></div><br>';
//tao danh sach cau hoi
$temp = new b_matching();
global $USER;
$str .= $temp->get_all_input($id_bbsurvey);
$array['str'] = $str;
$array['check_admin'] = $check_admin;
/* Viet doan code cua ban o day */
$mform = new form_input_management(null, $array);
$mform->display();
echo "<script type='text/javascript'>filter();</script>"; 
/*------Ket thuc doan code cua ban-------*/
//echo $OUTPUT->footer();
